package com.stlm2.dems.entity.base;

import com.stlm2.dems.entity.FlowType;
import com.stlm2.dems.entity.InventorySource;

import java.util.Date;

/**
 * Created by zlq on 2017/10/27.
 */
public class BaseInventoryLog {
    //ID 主键
    private int id;
    //库存表ID
    private int inventoryId;
    //用户ID
    private int userId;
    //1、+  2、 -
    private FlowType type;
    //库存来源
    private InventorySource inventorySource;
    //改变的值
    private int changeNum;
    //编码
    private String code;
    //生成时间
    private Date createTime;
    private String remark;

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getInventoryId() {
        return inventoryId;
    }

    public void setInventoryId(int inventoryId) {
        this.inventoryId = inventoryId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public FlowType getType() {
        return type;
    }

    public void setType(FlowType type) {
        this.type = type;
    }

    public InventorySource getInventorySource() {
        return inventorySource;
    }

    public void setInventorySource(InventorySource inventorySource) {
        this.inventorySource = inventorySource;
    }

    public int getChangeNum() {
        return changeNum;
    }

    public void setChangeNum(int changeNum) {
        this.changeNum = changeNum;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getTypeValue(){
        return (type != null) ? type.getIntValue() : null;
    }

    public void setTypeValue(Integer v){
        if(v != null)
            type = FlowType.getByIntValue(v);
    }

    public Integer getInventorySourceValue(){
        return (inventorySource != null) ? inventorySource.getIntValue() : null;
    }

    public void setInventorySourceValue(Integer v){
        if(v != null)
            inventorySource = InventorySource.getByIntValue(v);
    }
}
